// $('.rank').each(function (i) {
//     // console.log($('.rank').eq(i).html());
//     // console.log($('.rank
// ').eq(i+1).html());
//     var arr = [];
//     if ($('.rank').eq(i).html()>$('.rank').eq(i+1).html()){
//         arr = $('.rank').eq(i+1).html();
//         console.log(arr);
//     }
// })
function add() {
    var list = document.querySelector('ul');
    var listLi = document.querySelectorAll('li');
    var leng = listLi.length;
    list.innerHTML += '<li class="clearfix"><div class="ranking fl">'+100+'</div><div class="head_portrait fl">'+'<img src="../img/touxiang1.png" alt="">'+'</div><div class="name fl">'+xxx+'</div><div class="visitors fr"><span class="rank">'+101+'</span>位客宾</div></li>'
}

function sort(arr) {
    var liList = document.querySelectorAll('li');
    var rank = document.querySelectorAll('.rank');
    var arr = [];
    for(var k = 0; k<rank.length;k++){
        arr.push(parseInt(rank[k].innerHTML));
    }
    for(var i=0;i<arr.length-1;i++){
        for(var j=0;j<arr.length;j++){
            if(arr[i]>arr[j]){
                var arrs = arr[j];
                var arrList = liList[j].innerHTML;
                arr[j] = arr[i];
                arr[i] = arrs;
                liList[j].innerHTML = liList[i].innerHTML;
                liList[i].innerHTML = arrList;
            }
        }
    }
    console.log(arr);
}
sort();
